package com.matrix.gui;

import com.matrix.math.*;
import java.util.ArrayList;
import android.app.Application;

/**
 * Global Variables that can be shared between all the application's activities.
 * @author Sultan, and McGarvie
 * Last modified: April 27th, 2011
 */
public class Globals extends Application
{
	private ArrayList<MathObject> listItems;
	private int left, right, opType, view, count; // hold the indexes to objects from the list stored in boxes
	private ArrayList<Matrix> resultMatrix;
	private Vector resultVector;
	private ArrayList<ColumnVector> resultColVector;
	
	public Globals()
	{
		this.listItems = new ArrayList<MathObject>();
		this.setLeft(-1);
		this.setRight(-1);
	}
	/**
	 * setters and getters
	 */
	public int getCount(){return this.count;}
	public void incCount(){count++;}
	public MathObject get(int index){return this.getListItems().get(index);}
	public ArrayList<MathObject> getListItems(){return listItems;}
	public void setListItems(ArrayList<MathObject> listItems){this.listItems = listItems;}
	public int getLeft(){return left;}
	public void setLeft(int left){this.left = left;}
	public int getRight(){return right;}
	public void setRight(int right){this.right = right;}
	public ArrayList<Matrix> getResultMatrix(){return resultMatrix;}
	public void setOpType(int op)
	{
		opType = op;
	}
	public int getOpType()
	{
		return opType;
	}
	public void setView(int i)
	{
		view = i;
	}
	public int getView()
	{
		return view;
	}
	public void setResultMatrix(Matrix resultMatrix)
	{
		ArrayList<Matrix> temp = new ArrayList<Matrix>();
		temp.add(resultMatrix);
		this.resultMatrix = temp;
	}
	public void setResultMatrix(ArrayList<Matrix> resultMatrix)
	{
		this.resultMatrix = resultMatrix;
	}
	public void setResultColVector(ColumnVector c)
	{
		ArrayList<ColumnVector> temp = new ArrayList<ColumnVector>();
		temp.add(c);
		this.resultColVector = temp;
	}
	public void setResultColVector(ArrayList<ColumnVector> c)
	{
		this.resultColVector = c;
	}
	public ArrayList<ColumnVector> getResultColVector()
	{
		return resultColVector;
	}
	public Vector getResultVector(){return resultVector;}
	public void setResultVector(Vector resultVector){this.resultVector = resultVector;}
}
